<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh" class="no-js">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta charset="utf-8"/>
    <title>删除笔记</title>
</head>
<body>
<script src="/notesLists/js/jquery-2.1.1.min.js" type="text/javascript"></script>
    <script>
        var r = confirm("您确定要删除这篇笔记吗")
        obj = {
            id:<%=request.getParameter("id")%>
        }
        if(r == true){
            $.ajax({
                url:"/notesApi/delete.do",
                type:"get",
                data:obj,
                success:function(result){
                    if(result.code = 200){
                        alert("删除成功")
                        window.location.href = "index.jsp";
                    }else{
                        alert("删除失败,请重试")
                        window.location.href = "index.jsp";
                    }
                }
            })
        }else{
            alert("这才是明智的选择");
            window.location.href = "index.jsp";
        }
    </script>
</body>